/* 
 *	Copyright (C) 2009-2010 miaohua
 *	http://code.google.com/p/lrcshower/
 *
 *  This Program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2, or (at your option)
 *  any later version.
 *   
 *  This Program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU General Public License for more details.
 *   
 *  You should have received a copy of the GNU General Public License
 *  along with GNU Make; see the file COPYING.  If not, write to
 *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
 *  http://www.gnu.org/copyleft/gpl.html
 *
 */

#pragma once


// CProgressDlg dialog

class CProgressDlg : public CDialog
{
	DECLARE_DYNAMIC(CProgressDlg)

public:
    // Standard constructor
	CProgressDlg(const CString & Folder, bool IsRecurse, CDialog * Parent, CWnd* pParent = NULL);   
	virtual ~CProgressDlg();

    // Dialog Data
	enum { IDD = IDD_PROGRESS_DLG };

    void UpdateProg(const CString & FilePath, int Num);


protected:
    // DDX/DDV support
    BOOL OnInitDialog();
    afx_msg void OnBnClickedCancel();
    afx_msg void OnClose();
    afx_msg LRESULT OnDlgExit(WPARAM wParam, LPARAM lParam);
	virtual void DoDataExchange(CDataExchange* pDX);    
	DECLARE_MESSAGE_MAP()

private:
    // Helper functions
    // Add more files, use working thread
    // Working thread for adding a media folder
    static unsigned int WINAPI ThreadOnAddFolder(void* Param);  
	void OnAddFolder();
    void AddFolderHelper(const CString & Path);

    // Member data
    CString m_Folder;
    bool m_Exit;
    bool m_IsRecurse;
    HANDLE m_ThreadHdler;
    CDialog * m_ParentDlg;
};
